package org.ftc.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.ftc.util.EncryptEngin;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "USERS")
// @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Users extends BasicEntity implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3990031586343221019L;

	@Id
	@Column(name = "USERS_SEQ", length = 50)
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid2")
	private String usersSeq;

	@Column(name = "NAME", length = 50)
	private String name;
	//user id
	@Column(name = "USERNAME", length = 50)
	private String userName;

	@Column(name = "PASSWORD", length = 60)
	private String password;
	// 腳色
	@Column(name = "ROLE", length = 50)
	private String role;
	// 類型
	@Column(name = "TYPE", length = 10)
	private String type;
	// 部門代碼
	@Column(name = "DEPT_CODE", length = 3)
	private String deptCode;
	// 部門名稱
	@Column(name = "DEPT_NAME", length = 50)
	private String deptName;
	// 科
	@Column(name = "UNIT_CODE", length = 3)
	private String unitCode;
	// 科
	@Column(name = "UNIT_NAME", length = 50)
	private String unitName;
	// 職稱
	@Column(name = "TITLE", length = 50)
	private String title;

	@Column(name = "EMAIL", length = 100)
	private String email;// 信箱

	@Column(name = "EMP_CODE", length = 10)
	private String empCode;

	@Column(name = "DEC_LEVEL", length = 10)
	private String decLevel;

	@Column(name = "TELEPHONE", length = 20)
	private String telephone;

	@Column(name = "EXT", length = 10)
	private String ext;

	@Column(name = "STATUS")
	private Integer status;
	
	@Column(name = "STATUS2")
	private String status2;

	public String getUsersSeq() {
		return usersSeq;
	}

	public void setUsersSeq(String usersSeq) {
		this.usersSeq = usersSeq;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return EncryptEngin.decrypt(password);
	}

	public void setPassword(String password) {
		this.password = EncryptEngin.encrypt(password);
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getDeptCode() {
		return deptCode;
	}

	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String getUnitCode() {
		return unitCode;
	}

	public void setUnitCode(String unitCode) {
		this.unitCode = unitCode;
	}

	public String getUnitName() {
		return unitName;
	}

	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getEmpCode() {
		return empCode;
	}

	public void setEmpCode(String empCode) {
		this.empCode = empCode;
	}

	public String getDecLevel() {
		return decLevel;
	}

	public void setDecLevel(String decLevel) {
		this.decLevel = decLevel;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getExt() {
		return ext;
	}

	public void setExt(String ext) {
		this.ext = ext;
	}

	public String getStatus2() {
		return status2;
	}

	public void setStatus2(String status2) {
		this.status2 = status2;
	}


}
